var keystone = require('keystone');
var Types = keystone.Field.Types;
/**
 * Group Model
 * ==================
 */

var Message = new keystone.List('Message', {});

Message.add({
    title: {type: String, required: false},
    status: {type: Types.Select, options: 'draft，sendOut, unread, read, delete', default: 'draft'},
    messageType: {type: String, required: false}, //信息类型
    project: {type: String, required: false}, //项目
    Addressee: {type: String, required: false}, //收件人
    author: {type: Types.Relationship, ref: 'User', many: false}, //发件人
    content: {type: String, required: false},
    isReceipt: {type: String, required: false},
    createTime: {type: Types.Datetime, default: Date.now},
    updateTime: {type: Types.Datetime, default: Date.now},
    attachment: {type: String, required: false},
    //权限
    permissions: {type: String, required: false}
});

// UserGroup.relationship({ref: 'User', refPath: 'userGroup', path: 'users',});
Message.register();
